<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$item=pdo_get('zh_gjhdbm_system',array('uniacid'=>$_W['uniacid']));
if(checksubmit('submit')){
    $data['pt_name']=$_GPC['pt_name'];
    $data['tel']=$_GPC['tel'];
    $data['city_open']=$_GPC['city_open'];
    $data['bmsh_open']=$_GPC['bmsh_open'];  
    $data['style']=$_GPC['style']; 
   $data['ly_num']=$_GPC['ly_num'];
    $data['fb_notice']=html_entity_decode($_GPC['fb_notice']);
    $data['details']=html_entity_decode($_GPC['details']);
    $data['uniacid']=$_W['uniacid'];                     
    if($_GPC['color']){
        $data['color']=$_GPC['color'];
    }else{
        $data['color']="#ED414A";
    }
    if($_GPC['id']==''){                
        $res=pdo_insert('zh_gjhdbm_system',$data);
        if($res){
            message('添加成功',$this->createWebUrl('settings',array()),'success');
        }else{
            message('添加失败','','error');
        }
    }else{
        $res = pdo_update('zh_gjhdbm_system', $data, array('id' => $_GPC['id']));
        if($res){
            message('编辑成功',$this->createWebUrl('settings',array()),'success');
        }else{
            message('编辑失败','','error');
        }
    }
}
include $this->template('web/settings');